<?php

namespace common\models\patient;

use Yii;

/**
 * This is the model class for table "by_patient_clinic_record".
 *
 * @property int $id
 * @property int $project_id 项目ID
 * @property int $patient_user_id 用户ID
 * @property int $clinic_time 就诊时间
 * @property int $is_initial_clinic 是否为初诊（0：复诊 1：初诊）
 * @property int $source 数据来源（1：奕远 2：治疗室）
 * @property int $created_at 添加时间
 * @property int $updated_at 更新时间
 * @property string $clinic_day 到诊时间(日期到天)
 */
class ClinicRecord extends \common\models\BaseModel
{
    const SOURCE_HOSPITAL = 1; // 奕远
    const SOURCE_ROOM = 2; // 治疗室
    const CLINIC_FIRST = 1; // 初诊
    const CLINIC_SECOND = 0; // 复诊

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%patient_clinic_record}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['project_id', 'patient_user_id', 'clinic_time', 'is_initial_clinic', 'source', 'created_at', 'updated_at'], 'integer'],
            [['clinic_time'], 'required'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'project_id' => 'Project ID',
            'patient_user_id' => 'Patient User ID',
            'clinic_time' => 'Clinic Time',
            'is_initial_clinic' => 'Is Initial Clinic',
            'source' => 'Source',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }
}
